egret_h5.startGame = function() {
    var a = egret.MainContext.instance;
    a.touchContext = new egret.HTML5TouchContext();
    a.deviceContext = new egret.HTML5DeviceContext();
    a.netContext = new egret.HTML5NetContext();
    egret.StageDelegate.getInstance().setDesignSize(480, 740);
    a.stage = new egret.Stage();
    var g = egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ? egret.StageScaleMode.SHOW_ALL : egret.StageScaleMode.NO_SCALE;
    a.stage.scaleMode = g;
    var c = 0;
    if (c == 1) {
        a.rendererContext = new egret.WebGLRenderer()
    } else {
        a.rendererContext = new egret.HTML5CanvasRenderer()
    }
    egret.MainContext.instance.rendererContext.texture_scale_factor = 1;
    a.run();
    var e;
    if (document_class) {
        e = egret.getDefinitionByName(document_class)
    }
    if (e) {
        var f = new e();
        if (f instanceof egret.DisplayObjectContainer) {
            a.stage.addChild(f)
        } else {
            throw new Error("文档类必须是egret.DisplayObjectContainer的子类!")
        }
    } else {
        throw new Error("找不到文档类！")
    }
    var d = null;
    var b = function() {
        a.stage.changeSize();
        d = null
    };
    window.onresize = function() {
        if (d == null) {
            d = setTimeout(b, 300)
        }
    }
}